home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Views / ViewMap.h < prev    next >
Text File  |  1997-06-28  |  2KB  |  72 lines

  1. // ViewMap.h
  2.  
  3. #ifndef ViewMap_h
  4. #define ViewMap_h
  5.  
  6. #ifndef RegionObject_h
  7. #include "RegionObject.h"
  8. #endif
  9.  
  10. class View;
  11. class WindowObject;
  12. class GrafPortObject;
  13.  
  14. class ViewMap
  15.   {
  16.     private:
  17.         WindowObject *window;
  18.         Rectangle bounds;
  19.         RegionObject clip;
  20.         bool visible;
  21.         Rectangle visibleBounds;
  22.         
  23.         const ViewMap *previous;
  24.         static const ViewMap *current;
  25.         
  26.         static RegionObject& Invalid( const WindowObject& );
  27.         
  28.         void SetToVisible( const View& );
  29.         
  30.     public:
  31.         enum IncludeInvalid    { includeInvalid };
  32.         enum InvalidOnly        { invalidOnly };
  33.  
  34.         ViewMap( const View& );
  35.         ViewMap( const View&, IncludeInvalid );
  36.         ViewMap( const View&, InvalidOnly );
  37.         ViewMap( const ViewMap& );
  38.         
  39.         ~ViewMap();
  40.         
  41.         void operator=( const ViewMap& );
  42.         void Set( const ViewMap&, const Rectangle& restriction );
  43.         
  44.         bool HasWindow() const                        { return window != 0; }
  45.         
  46.         const WindowObject& Window() const        { Assert( window != 0 ); return *window; }
  47.         GrafPortObject& Port() const;
  48.         const Rectangle& Bounds() const            { Assert( window != 0 ); return bounds; }
  49.         const RegionObject& Clip() const            { Assert( window != 0 ); return clip; }
  50.         bool Visible() const                            { return visible; }
  51.         const Rectangle& VisibleBounds() const    { Assert( visible ); return visibleBounds; }
  52.         
  53.         void RestrictTo( const Rectangle& );
  54.         void RestrictTo( const RegionObject& );
  55.         
  56.         void Validate() const;
  57.         void Validate( const Rectangle& ) const;
  58.         void Validate( const RegionObject& ) const;
  59.  
  60.         void Invalidate() const;
  61.         void Invalidate( const Rectangle& ) const;
  62.         void Invalidate( const RegionObject& ) const;
  63.         
  64.         void Erase() const;
  65.         void Erase( const Rectangle& ) const;
  66.         void Erase( const RegionObject& ) const;
  67.         
  68.         void Reassert() const;
  69.   };
  70.  
  71. #endif
  72.